class Shape{
    public void draw() {
        System.out.println("画图形!");
    }
}

class Rect extends Shape {
    @Override
    public void draw(){
        System.out.println("画矩形!");
    }
}

class Circu extends Shape {
    public void draw(){
        System.out.println("画圆!");
    }
}

class Trigan extends Shape {
    public void draw(){
        System.out.println("画三角!");
    }
}

public class Polymorphic {
    public static void drawMap(Shape shape) {
        shape.draw();
    }

    public static void main(String[] args) {
        Rect rect = new Rect();
        drawMap(rect);

        drawMap(new Circu());
    }

    public static void main1(String[] args) {
        Shape shape1 = new Rect();
        shape1.draw();

        Shape shape2 = new Circu();
        shape2.draw();

        Shape shape3 = new Trigan();
        shape3.draw();

    }
}
